package com.yiip.mr.etl.gulivideo;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class GuliVideoMapper extends Mapper<LongWritable, Text, NullWritable,Text> {

    private Text v = new Text();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        //1、读取数据
        //2、数据清洗
        //3、写出数据

        String oriStr = value.toString();

        String etlStr = ETLUtil.etlStr(oriStr);

        v.set(etlStr);
        context.write(NullWritable.get(),v);
    }
}
